<script setup lang="ts">
import MainMenu from '@/components/main-menu/main-menu.vue'
import MainHeader from '@/components/main-header/main-header.vue'

const isFold = ref(false)
const foldChange = (flag: boolean) => {
  isFold.value = flag
}
</script>

<template>
  <div class="main">
    <el-container class="main-content">
      <el-aside :width="isFold ? '60px' : '210px'">
        <main-menu :isFold="isFold"></main-menu>
      </el-aside>
      <el-container>
        <el-header height="50px">
          <main-header @foldChange="foldChange"></main-header>
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<style scoped lang="less">
.main {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.page,
.main-content {
  height: 100%;
  .el-aside {
    background-color: palegoldenrod;
  }
}
.page-content {
  height: calc(100%-48px);
  .page-info {
    background-color: #fff;
    border-radius: 5px;
  }
}

.el-header .el-footer {
  display: flex;
  color: #333;
  text-align: center;
  align-items: center;
}

.el-header {
  height: 48px !important;
}
.el-aside {
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 200px;
  cursor: pointer;
  background-color: #333;
  transition: width 0.4s linear;
  scrollbar-width: none;
  -ms-overflow-style: none;
  &::-webkit-scrollbar {
    display: none;
  }
}

.el-main {
  color: #333;
  // text-align: center;
  background-color: #f2f2f5;
}
</style>
